package cn.wolfcode.shop.web;

import cn.wolfcode.shop.web.resolver.UserArgumentsResolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**WebMvcConfigurer接口配置了MVC层面上的一些配置处理功能
 * 比如:在请求过来的时候的拦截器,对请求参数的解析器等
 */
@Configuration
public class WebConfig implements WebMvcConfigurer{
    @Autowired
    private UserArgumentsResolver userArgumentsResolver;
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(userArgumentsResolver);
    }

}
